filechooser: Tighten up some assertions when actually selecting files in the treeview
authorFederico Mena Quintero <federico@gnome.org>
Wed, 20 Feb 2013 23:14:20 +0000 (17:14 -0600)
committerFederico Mena Quintero <federico@gnome.org>
Thu, 21 Feb 2013 02:09:02 +0000 (20:09 -0600)
The model must be fully loaded, and it must be inserted in the treeview.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserdefault.c

index 45d53b09cb5fa43d79ba3cef17cee34598b73b40..3a49bdf8e2cb916698980d8d6fbfc802d039670f 100644 (file)
@@ -6404,9 +6404,14 @@ show_and_select_files (GtkFileChooserDefault *impl,
   gboolean selected_a_file;
   GSList *walk;
 
+  g_assert (impl->load_state == LOAD_FINISHED);
+  g_assert (impl->browse_files_model != NULL);
+
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
   fsmodel = GTK_FILE_SYSTEM_MODEL (gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view)));
 
+  g_assert (fsmodel == impl->browse_files_model);
+
   enabled_hidden = impl->show_hidden;
   removed_filters = (impl->current_filter == NULL);